﻿using DevExpress.Mvvm;
using DevExpress.Mvvm.DataAnnotations;
using DevExpress.Mvvm.Native;
using DevExpress.Mvvm.POCO;
using VGTimer.Models;
using HandyControl.Controls;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;

namespace VGTimer.ViewModels
{
    [POCOViewModel]
    public class StatusViewModel
    {
        public StatusViewModel()
        {
            AllDevices = ConfigInfo.Instance.AllDevices;
            Messenger.Default.Register<bool>(this, "1", true, OnRefresh);
        }

        private void OnRefresh(bool obj)
        {
            AllDevices = null;
            AllDevices = ConfigInfo.Instance.AllDevices;

        }

        public void Loaded()
        {
        }

        public virtual ObservableCollection<Device> AllDevices { get; set; }
    }
}
